package cn.eaay.stock.service.impl;

import cn.eaay.stock.common.enums.ResponseCode;
import cn.eaay.stock.mapper.StockBusinessMapper;
import cn.eaay.stock.service.StockBusinessService;
import cn.eaay.stock.vo.resp.R;
import cn.eaay.stock.vo.stock.StockBusinessVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 股票业务服务
 */
@Service
public class StockBusinessServiceImpl implements StockBusinessService {

    @Resource
    private StockBusinessMapper selectStockDescribe;

    /**
     * 获取股票业务详情
     *
     * @param code
     * @return
     */
    @Override
    public R<StockBusinessVo> getStockDescribe(String code) {
        StockBusinessVo data = selectStockDescribe.selectStockDescribe(code);
        if (null == data) {
            return R.error(ResponseCode.EMPTY_DATA.getMessage());
        }
        return R.ok(data);
    }
}
